#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

#ifndef _POLYNOMIAL_H_
#define _POLYNOMIAL_H_




class Polynomial
{
private:
  int d;                         //the degree of the polynomial
  vector<double> Coef;           //the coefficients of the polynomial,from low-order item to high-order item,which has d+1 numbers
public:
  Polynomial(){};
  Polynomial(int m,vector<double> arr);
  Polynomial operator+(Polynomial p)const;
  Polynomial operator-(Polynomial p)const;
  Polynomial operator*(const Polynomial &p)const;
  friend Polynomial operator*(double c,const Polynomial &p);
  friend ostream& operator<<(ostream& os,const Polynomial &p); 
  double get_value(double x)const;      //return evaluation at some x
  Polynomial get_deri()const;           //return derivative of the polynomial
  double get_deri_value(double x)const; //return the value of derivative at some x
  int get_d()const;                     //return degree d
  vector<double> get_Coef()const;       //return coefficients
  ~Polynomial(){};
};


#endif
